package com.shg.service;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.List;

import com.shg.bean.Book;
import com.shg.bean.QueryResult;

@SuppressWarnings("unchecked")
public interface BasiceDao<E> {
	/**
	 * 向数据库表插入一条记录
	 * @param 实体对象
	 */
	public void insert(E entity);
	
	public void delete(Class<Object> entity,String id,String id_value);
	
	public void update(E entity)throws Exception;	
	
	public Object select(Class entity,Serializable entityID)throws Exception;
	
	//统计总记录数
	public Long getTotal(Class<E> entity,String whereSQL,Object[] parameters)throws Exception;
	
	public QueryResult<E> getPagination(Class<E> entity,LinkedHashMap<String, String> orderby)throws Exception;
	
	public QueryResult<E> getPagination(Class<E> entity,int firstResult,int maxResult)throws Exception;
	
	public QueryResult<E> getPagination(Class<E> entity,int firstResult,int maxResult,String whereSQL,Object[] parameters)throws Exception;
	
	public List<Book> getStat(String shopId,int maxResult,Class<E> entity)throws Exception;
	
	public QueryResult<E> getPagination(Class<E> entity,int firstResult,int maxResult,String whereSQL)throws Exception;
	
	public QueryResult<E> getPagination(Class<E> entity,int firstResult,int maxResult,LinkedHashMap<String, String> orderby)throws Exception;
			
	public QueryResult<E> getPagination(Class<E> entity,int firstResult,int maxResult,String where,Object[] parameters,LinkedHashMap<String, String> orderby)throws Exception;
}
